@extends('layouts.admin')
@push('morecss')
    <link href="//cdn.tudouyu.cn/AdminInspinia/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css"
          rel="stylesheet">
@endpush

@push('morescript')
    <script type="application/javascript">
        let page_params = {
            @can('admin.wxmass.index')
            url_list: '{{ route('admin.wxmass.index') }}',
            @endcan
            @can('admin.wxmass.create')
            url_add: '{{ route('admin.wxmass.create') }}',
            @endcan
            @can('admin.wxmass.update')
            url_edit: '{{ route('admin.wxmass.update') }}',
            @endcan
            @can('admin.wxmass.destroy')
            url_del: '{{ route('admin.wxmass.destroy') }}',
            @endcan
            @can('admin.wxmass.preview')
            url_preview: '{{ route('admin.wxmass.preview') }}',
            @endcan
            @can('admin.wxmass.upsetspeed')
            url_upsetspeed : '{{ route('admin.wxmass.upsetspeed') }}',
            @endcan
            @can('admin.wxmass.syncstatus')
            url_syncstatus: '{{ route('admin.wxmass.syncstatus') }}',
            @endcan
        }
    </script>
    <!-- require page js -->
    <script src="{{ mix('js/admin/wxmass_index.js') }}"></script>
@endpush
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight ecommerce">
        <div class="ibox-content m-b-sm border-bottom">
            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group">
                        <label class="control-label" for="keyword">关键字</label>
                        <input type="text" id="keyword" name="keyword" value="" placeholder="请输入搜索关键字"
                               class="form-control">
                    </div>
                </div>
                <div class="col-sm-2">
                    <div class="form-group">
                        <label class="control-label" for="product_name">&nbsp;&nbsp;</label>
                        <div>
                            <button class="btn btn-primary" type="button" id="btn-search"><i class="fa fa-search"></i>
                                搜索
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="toolbar" class="col-sm-5" style="width: 300px;">
            @can('admin.wxmass.create')
            <a class="btn btn-primary" href="{{ route('admin.wxmass.create') }}"><i class="fa fa-plus"></i> 添加群发</a>
            @endcan
            @can('admin.wxmass.upsetspeed')
                <button class="btn btn-primary" type="button" id="btn-speed"><i class="fa fa-cog"></i> 设置群发速度</button>
            @endcan
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox">
                    <div class="ibox-content">
                        <table id="table" data-classes="table table-no-bordered">
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 群发预览 -->
    <div class="ibox-content" id="box-preview" style="display: none">
        <form class="form-horizontal m-t" method="post" action="">
            <input type="hidden" name="mass_id" id="mass_id"/>
            <input type="hidden" name="msg_type" id="msg_type"/>
            <div class="form-group">
                <label class="col-sm-3 control-label">用户识别类型：</label>
                <div class="input-group col-sm-7">
                    <div class="radio radio-info radio-inline">
                        <input type="radio" id="previewType_1" value="touser" name="previewType" checked>
                        <label for="previewType_1"> 用户openId </label>
                    </div>
                    <div class="radio radio-info radio-inline">
                        <input type="radio" id="previewType_2" value="wxname" name="previewType">
                        <label for="previewType_2"> 用户微信号</label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">用户标识：</label>
                <div class="input-group col-sm-7">
                    <input id="to" type="text" class="form-control" name="to" aria-required="true">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-4">
                    <button class="btn btn-primary btn-sub" type="button">提交</button>
                </div>
            </div>
        </form>
    </div>
    <!-- 群发速度设置 -->
    <div class="ibox-content" id="box-speed" style="display: none">
        <form class="form-horizontal m-t" method="post" action="">
            <div class="form-group">
                <label class="col-sm-3 control-label">群发速度：</label>
                <div class="input-group col-sm-7">
                    <select id="speed" name="speed" class="form-control" v-model="massData.filter_rule.type">
                        @foreach($speedType as $k => $v)
                            <option value="{{ $k }}">{{ $v }}w/分钟</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-4">
                    <button class="btn btn-primary btn-sub" type="button">提交</button>
                </div>
            </div>
        </form>
    </div>
@endsection